<%@ page isELIgnored="false" %>
<%@ page contentType="text/html" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>EM Live Ranking - Edit</title>
</head>
<body>
Neues Team:<br/><br/>
<form:form action="savetournament.html" commandName="tournament">
  Name:<FONT color="red"><form:errors path="name"/></FONT><form:input path="name" size="75"/>
  <input type="submit" value="Speichern"/>
</form:form>
<hr/>
Alle Teams:
<table>

  <c:forEach items="${tournaments.tournaments}" varStatus="idx">
    <tr>
      <td>
        <form:form action="updatetournament.html" commandName="tournament[${idx.index}]">
          <form:hidden path="id"/>
          Name:<form:input path="name" size="55"/>
          <input type="submit" value="Aktualisieren"/>
        </form:form></td>
      <td><form:form action="deletetournament.html?id=${tournaments.tournaments[idx.index].id}"
                     commandName="tournaments">
        <form:hidden path="tournaments[${idx.index}].id"/>
        <input type="submit" value="Löschen"/>
      </form:form></td>
    </tr>
  </c:forEach>
</table>
<%--<c:forEach items="${players}" var="player">--%>
<%--<form action="update.html" method="post">--%>
<%--<input type="text" value="${player.name}" name="name"/><input type="submit" value="Update"/>--%>
<%--<c:out value="${player.name}"/> - <c:out value="${player.score}"/></br>--%>
<%--</form>--%>
<%--</c:forEach>--%>
</body>
</html>